package hos.map;

import android.annotation.SuppressLint;

import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.arch.core.internal.FastSafeIterableMap;

import java.util.Map;

/**
 * <p>Title: FastSafeMap </p>
 * <p>Description:  </p>
 * <p>Company: www.mapuni.com </p>
 *
 * @author : 蔡俊峰
 * @version : 1.0
 * @date : 2023/8/3 14:43
 */
@SuppressLint("RestrictedApi")
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
public class FastSafeMap<K, V> extends FastSafeIterableMap<K, V> {

    @Nullable
    public Map.Entry<K, V> getEntry(K k) {
        return get(k);
    }

    @Nullable
    public V getValue(K k) {
        if (!contains(k)) {
            return null;
        }
        Map.Entry<K, V> entry = getEntry(k);
        if (entry != null) {
            return entry.getValue();
        }
        return null;
    }

}
